<!DOCTYPE html>
<html>
<head>
    <title>规则包管理页面</title>
</head>
<link href="/static/css/controls.css" rel="stylesheet" type="text/css">
<script>var ctx = '';
var basePath = '/grule-manager';</script>

<script src="/bower_components/requirejs/require.js" data-main="/static/app.js" data-bootstrap-modules="'system/ruleExpression/RulePackageModule'"></script>
<body ng-controller="RulePackageController" ng-cloak>

规则包名称：<input type="text" ng-model="search.name">

<button ng-click="searchRulePackage()">查询</button>
<button ng-click="showAddRulePackage()">新增</button>
<g-data-source url="/grule-manager/rulePackage" data-source-name="rulePackageSource" page="true" allow-auto-load="true"></g-data-source>

<g-data-source url="/grule-manager/ruleParser/parser" data-source-name="release" />
<br>
<br>
<br>
<hr>
<div ng-show="showPage">
    <g-data-grid data-source-name="rulePackageSource"
                 data-on-load-success="rulePackageRendered(grid)"
                 selected-row="selectedRow"
                 on-select="selectRow(record)"
                 g-height="300"
                 ng-cloak>
        <g-column width="150" data="name" >规则包名称</g-column>
        <g-column width="150" data="groupId" >groupId</g-column>
        <g-column width="150" data="artifactId" >artifactId</g-column>
        <g-column width="100" data="version" >版本</g-column>
        <g-column width="500">
            <i class="fi fi-set"></i>&nbsp;操作
            <g-column-tmpl>
                <g-action-remove on-before-action="onRemoveRecord($event, record)"></g-action-remove>
                <a href="javascript:" ng-click="grid.actions.edit(row)">编辑</a>
                <a target="_blank" href="/html/variables/manager#/?scope=1&scopeId={{row.id}}" >添加包变量</a>
                <a href="/html/ruleExpression/ruleAssemblyManager#/?rulePackageId={{row.id}}" >添加规则集</a>
                <a href="/html/unitcases/manager#/?artifactId={{row.artifactId}}&groupId={{row.groupId}}" >新增测试用例</a>
                <a href="javascript:" ng-click="compile(row.id)" >编译</a>
                <a href="javascript:" ng-click="test(row)">测试</a>
                <a href="javascript:" ng-click="publish(row)">发布</a>
                <a href="javascript:" ng-click="showVersions(row)">查看版本</a>
            </g-column-tmpl>
        </g-column>
    </g-data-grid>
    <g-pagination-navi source-name="rulePackageSource"></g-pagination-navi>
    <g-pagination-size source-name="rulePackageSource"></g-pagination-size>
</div>
</div>

<div ng-show="showAdd">
   <textarea ng-model="addRulePackage" rows="30" cols="100">
    </textarea>
    <button ng-click="createRulePackage()">保存</button>
    <button ng-click="showPageView()">返回</button>
</div>

<div ng-show="showEdit">
    id: <input readonly="readonly" ng-model="currId"><br>
    <textarea ng-model="editRulePackage" rows="30" cols="200" >
    </textarea>
    <button ng-click="updateRulePackage()">保存</button>
    <button ng-click="showPageView()">返回</button>
</div>
<div>
    <textarea id="logDetail" style="background-color: black;color: #999;" ng-model="logDetail" rows="30" cols="150" ng-disabled="true">
    </textarea>
    <button ng-show="showClear" ng-click="clear()">清空</button>
</div>

</body>
</html>
